#pragma once

#include "effectbase.h"
#include <osg\Vec4>
#include <osg\BoundingBox>
#include <osg\Node>
#include "transformable.h"

namespace VrDataCore
{
	class VRDATACORE_EXPORT CommonShapeEffect:public EffectBase
	{
	public:
		CommonShapeEffect();
	protected:
		~CommonShapeEffect();
		osg::ref_ptr<osg::Node> createShape(CoreBase::ActorBase* actor,int type,osg::BoundingBox& box,const osg::Vec4& color=osg::Vec4(0.0,1.0,0.0,1.0),bool opacity=false);
	public:
		virtual void buildPropertyMap();
		virtual osg::ref_ptr<CoreBase::ActorBase> clone();
		virtual void apply(CoreBase::ActorBase* actor);
		virtual void unApply(CoreBase::ActorBase* actor);
		void setMaterial(osg::Vec4 material);
		osg::Vec4 getMaterial();
		void setShapeType(int type);
		int getShapeType();
		void setAutoSize(bool autosize); 
		bool getAutoSize();
		void setCanBeBlock(bool on);
		bool getCanBeBlock();
		void setRadious(float radious);
		float getRadious();
		void setHeightPercent(float height);
		float getHeightPercent();
		void setHeightTotal(float height);
		float getHeightTotal();
	private:
		osg::Vec4								_materialValue;
		osg::ref_ptr<CoreBase::Transformable>				_shapeTransformable;
		int										_shapeType;
		bool									_autoSize;
		bool									_canBeBlock;
		float									_radious;
		float									_heightPercent;
		float									_heightTotal;
	};
}